package constant;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IBM on 2017/4/10.
 */
public class ConstantPool {
    private List<ConstantInfo> constantInfos = new ArrayList<ConstantInfo>();


    public ConstantPool(){

    }
    public void addConstantInfo(ConstantInfo info){

        this.constantInfos.add(info);

    }

    public ConstantInfo getConstantInfo(int index){
        return this.constantInfos.get(index);
    }
    public String getUTF8String(int index){
        return ((UTF8Info)this.constantInfos.get(index)).getValue();
    }
    public Object getSize() {
        return this.constantInfos.size() -1;
    }

}
